# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

# Create your models here.
class Student(models.Model):
    s_number = models.IntegerField(primary_key=True) # 学生学号
    s_name = models.CharField(max_length=20) # 学生姓名
    sex = models.CharField(max_length=2) # 学生性别
    subject = models.CharField(max_length=20) # 学生专业
    grade = models.CharField(max_length=20) # 学生年级
    ID_number = models.IntegerField() # 学生身份证号
    native_place = models.CharField(max_length=30) # 学生籍贯

class Lesson(models.Model):
    l_number = models.IntegerField(primary_key=True) # 课程编号
    l_name = models.CharField(max_length=30) # 课程名称
    credit = models.CharField(max_length=6) # 课程学分
    time = models.IntegerField() # 课程学时

class Teacher(models.Model):
    t_number = models.IntegerField(primary_key=True) # 老师工号
    t_name = models.CharField(max_length=10) # 老师姓名
    t_pass = models.IntegerField(max_length=6, null=True) # 登录密码
    t_lesson_id = models.IntegerField(max_length=10) # 所授课程编号
    t_lesson_name = models.CharField(max_length=10) # 所授课程名称

class Score(models.Model):
    sName = models.CharField(max_length=10) # 学生姓名
    sNum = models.IntegerField(max_length=15) # 学生学号
    lName = models.CharField(max_length=10) # 课程名称
    lNum = models.IntegerField(max_length=10) # 课程编码
    score = models.IntegerField(max_length=3) # 课程成绩
    lCredit = models.CharField(max_length=6) # 课程学分
    lTime = models.IntegerField(max_length=5) # 课程学时

class Steacher(models.Model):
    St_number = models.IntegerField(primary_key=True) # 管理员账号
    St_pass = models.IntegerField() # 管理员密码